In a multiprocessing environment it is desirable to use latches, also known as locks, on control structures in order to govern access to the control information which is used by more than one processor. A control structure is typically a control block or a table in main memory, such as the subchannel as defined in the IBM 370-XA architecture. In the case of a subchannel, the control structure acts as the logical representation of a physical device (such as DASD, printers . . . ). The subchannel control block reflects the current status of the physical device. Therefore control of the subchannel control block means control of the physical device. Other types of control structures are associated with data elements or data arrays which reside in main memory of the multiprocessing system.
Some multiprocessing environments allow more than one processor to access control structures in "shared" mode when these processors intend only to read the control structure. A processor which intends to modify the control structure, a write operation for example, must be forced to wait until all of the processors which are currently accessing the control structure in a shared mode, release the control structure. An important aspect of any locking design is that there be no possibility that a processor can be "locked out". To prevent lockouts, a processor which submits a request for access to the control structure must eventually be granted the access it requested.
The amount of space occupied by the latch-control field and the amount of time to process a request for access should be kept to a minimum. Control structures tend to exist in the form of large arrays, and individual elements must be kept as small as possible. Some prior art methods of controlling access to shared structures have involved linked lists of pointers to the requesting processors. These lists are undesirable in that they occupy a great deal of space and also require several machine cycles to process a request.
Furthermore, some processors have a small cache-line size, so that a small latch-control field allows other useful information to be packed into the same line in which the latch-control field is placed. In some locking designs, all of the information needed during normal processing cannot be contained in a single line. This requires more than one read operation (more machine cycles) for a processor to even determine if it can gain access to the control structure.
It is therefore one object of this invention to provide a locking mechanism for shared control structures in a multiprocessor environment.
It is also an object of this invention to allow shared access to common control structures.
It is a further object of this invention to prevent the possibility of a processor being locked out of access to the control structure.
It is another object of this invention to decrease the size of the control words required to manage access to shared control structures.